

import React  ,{useState,useEffect}from 'react';
import { Space, Table, Tag } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import * as service from "../../api/index"
import { useNavigate } from 'react-router-dom'
interface Props{

}
interface DataType {
    key: string;
    name: string;
    age: number;
    address: string;
    tags: string[];
  }
  
function Tousu_List (props:Props) {
  var navigate = useNavigate();
  const columns: ColumnsType<DataType> = [
    {
      title: '序号',
      dataIndex: 'serial',
      key: 'serial',
      render: (text) => <a>{text}</a>,
    },
    {
      title: 'ID',
      dataIndex: 'BS',
      key: 'BS',
    },
    {
      title: '评价办件|办件编码',
      dataIndex: 'headline',
      key: 'headline',
    },
    {
      title: '办理人员',
      dataIndex: 'type',
      key: 'type',
    },
    {
      title: '评价人',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '评价结果',
      dataIndex: 'state',
      key: 'state',
    },
    {
      title: '评价时间',
      dataIndex: 'PJtime',
      key: 'PJtime',
    },
    {
      title: '操作',
      key: 'action',
      render: (_, record) => (
        <Space size="middle">
          <a >回复</a>
          <a onClick={()=>{zou(record)}}>查看</a>
          <a onClick={()=>{deletes(record)}}>删除</a>
        </Space>
      ),
    },
  ];
  //删除
  const deletes= async (record:any)=>{
      console.log("删除",record)
  }


  const zou=(record:any)=>{
      console.log("111")
      navigate("/Particulars/"+record.id)
  }
  var [list2, setlist] = useState([]);
  const list= async ()=>{
      var res= await service.Zixun_list()
      console.log(res)
      setlist(res.data)
     
  }
  useEffect(()=>{
      list()
  },[])
    const data: DataType[] = [
      
      ];
      
    return (
        <div>
            <Table columns={columns} dataSource={list2} />;
        </div>
    );
}

export default Tousu_List ;